package com.damon.dm_mail.service.impl;

import com.damon.dm_mail.pojo.Email;
import com.damon.dm_mail.pojo.Sender;
import com.damon.dm_mail.pojo.SenderCounter;
import com.damon.dm_mail.pojo.UserInfo;
import com.damon.dm_mail.mapper.MailMapper;
import com.damon.dm_mail.service.MailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MailServiceImpl implements MailService {

    @Autowired
    MailMapper mailMapper;

    public List<UserInfo> queryAllUserInfo() {
        return mailMapper.queryAllUserInfo();
    }

    @Override
    public List<UserInfo> queryUserInfosByNum(int start, int end) {
        return mailMapper.queryUserInfosByNum(start, end);
    }

    @Override
    public UserInfo queryUserInfoById(int id) {
        return mailMapper.queryUserInfoById(id);
    }

    @Override
    public void saveLastIndex(int lastIndex) {
        mailMapper.saveLastIndex(lastIndex);
    }

    @Override
    public SenderCounter getLastIndex() {
        return mailMapper.getSenderCounter();
    }

    @Override
    public List<Sender> queryAllSender() {
        return mailMapper.queryAllSender();
    }

    @Override
    public Sender queryASender() {
        return mailMapper.queryASender();
    }

    @Override
    public List<Email> queryAllEmail() {
        return mailMapper.queryAllMail();
    }
}
